; E:\PORNPOJ\Y2005\INC361\EX2010\SC02.C - Compiled by CC68K  Version 5.00 (c) 1991-2005  Peter J.Fondse
; #include <stdlib.h>
; #include <malloc.h>
; #define SW  *(unsigned char*)0xe001
; #define LED  *(unsigned char*)0xe003
; #define  VEC  *(void *)0x0080
; void isr(void);
; void isr(void)
; {
       section   code
       xdef      _isr
_isr:
       rts
; }
; typedef void (*FP)(void);
; typedef struct
; {
; char grade;
; int score;
; }STD;
; FP fpt;
; STD *sp;
; //void (*0x0800)(void) = isr;
; void main()
; {
       xdef      _main
_main:
; VEC = isr;
       lea       _isr,A0
       move.l    A0,128
; fpt = isr;
       lea       _isr,A0
       move.l    A0,_fpt
; sp = calloc(1,sizeof(STD));
       pea       4
       pea       1
       bsr       _calloc
       addq.w    #8,A7
       move.l    D0,_sp
; while(1)
main_1:
; {
; LED = ((SW & 0xfc)| 0x0c)^ 0x30;     // ~  bitwise   ! logical
       move.b    57345,D0
       and.l     #255,D0
       and.l     #252,D0
       or.l      #12,D0
       moveq     #48,D1
       eor.l     D1,D0
       move.b    D0,57347
main_2:
       bra       main_1
main_3:
       rts
; }
; }
; #if 0
; if((swBuff & swPattern) != 0)
; {
; ledBuff = ledBuff | ledPattern ;
; }
; #if 0
; swPattern = swPattern << 1;
; ledPattern = ledPattern >>1;
; #endif
; #endif
       section   bss
       xdef      _fpt
_fpt:
       ds.b      4
       xdef      _sp
_sp:
       ds.b      4
       xref      _calloc
